#include<stdio.h>
int main(void)
{
    int d,day; 
        scanf("%d",&d);
    day = d + 2;
    if(day>7){
    
        day-=7;
    }
    printf("%d\n",day);
    
    return 0;
}
